import http from './http'

const getAllDepartments = () => {
    const path = "/staff/departments/"
    return http.get(path)
}
const addStaff = (data) => {
    const path = "/staff/staff/"
    return http.post(path, data)
}
const listStaff = (page=1, size=10, params) => {
    const path = "/staff/staff/"
    params = params?params:{}
    params['size'] = size
    params['page'] = page
    return http.get(path, params)
}
const updateStaff = (staff_id, data) => {
    const path = "/staff/staff/" + staff_id + '/'
    return http.put(path, {"status":data.status, "telephone":data.telephone})
}
const downloadStaff = (pks) => {
    const path = "/staff/download/"
    return http.downloadFile(path, {"pks":JSON.stringify(pks)})
}
export default {
    getAllDepartments,
    addStaff,
    listStaff,
    updateStaff,
    downloadStaff,
}